  		layui.use(['form','layer','jquery'],function(){
  			var form = layui.form,
  			layer = layui.layer,
  			$ = layui.$;
  			
	  		//自定义校验密码
				form.verify({
					password: [
		    					/^[\S]{6,12}$/
		    					,'密码必须6到12位，且不能出现空格'
		  		] 
				});
				
				//获取上个页面传过来的参数,手机号或邮箱
			  	var loc = location.href;
				var n1 = loc.length;//地址的总长度
				var n2 = loc.indexOf("=");//取得=号的位置
				var result = decodeURI(loc.substr(n2+1, n1-n2));//从=号后面的内容
			  	console.log(result);
			
			//提交表单
			form.on('submit(LAY-user-resetpass)',function(data){
				var field = data.field,
				inputpass = field.password,				//密码
				repass = field.repass;					//确认密码
				
				//确认密码
			    if(inputpass !== repass){
						layer.msg('两次密码输入不一致');
			    }else{//md5加密
			    	var salt = g_passsword_salt;
					var str = ""+salt.charAt(2)+salt.charAt(3)+salt.charAt(1)+inputpass + salt.charAt(6)+salt.charAt(7);
			      	var password = $.md5(str);
			    }
			    console.log(password);
		      	//请求
		      	$.ajax({
		      		type:"post",
		      		url:urlHead + "/modify/resetPassword",
		      		async:true,
		      		data:{
		      			"email":result,
		      			"newPassword":password
		      		},
		      		success:function(res){
		      			console.log(res);
		      			if(res.code==0){
		      				layer.msg('重置密码成功',{icon:6});
		      			}else{
		      				layer.msg(res.msg,{icon:5});
		      			}
		      		},
		      		error:function(){
		      			layer.msg('重置密码失败',{icon:5});
		      		},
		      		dataType:"json"
		      	});
		      	
		      	return false;
			});
		});